@extends('admin.layout')
@section('content')

 <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                商家管理
                <small>编辑</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i>后台主页</a></li>
                <li><a href="#">商家管理</a></li>
                <li class="active">编辑</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="row">
                <!-- left column -->
                <div class="col-md-12">
                    <!-- general form elements -->
                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title">快速编辑商家</h3>
                        </div><!-- /.box-header -->
                        <!-- form start -->
                        <form role="form" action="{{url('/admin/businesses/update')}}" method="post" enctype = "multipart/form-data">
                        	{{csrf_field()}}

                            <input type="hidden" name="id" value="{{$data -> id}}">
                            <div class="box-body">
                            @if(count($errors) > 0)
	                            <div class="alert alert-danger alert-dismissable">
				                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
				                    <h4><i class="icon fa fa-ban"></i>温馨提示!</h4>
				                   		<ul>
				                   			@foreach($errors -> all() as $error)
				                   			<li>
				                   				{{$error}}
				                   			</li>
				                   			@endforeach
				                   		</ul>
				                </div>
				            @endif
                                <div class="form-group">
                                    <label for="exampleInputEmail1">商家名</label>
                                    <input type="text" name="username" value="{{($data -> username)}}"class="form-control" id="exampleInputUsername"
                                           placeholder="请输入商家名。">
                                </div>
                                <!-- <div class="form-group">
                                    <label>商家分类</label>
                                    <input type="text" class="form-control" name="price" value="{{($cates -> name)}}"id="exampleInputPassword1">
                                </div> -->
                                
                                
                                
                                <div class="form-group">
                                    <label for="exampleInputFile">原始图片</label>
                                    <img src="{{$data -> img}}" width="200"/>
                                    <input id="exampleInputFile" name="img" type="file">
                                    <p class="help-block">原始图片</p>
                                </div>

                                <div class="form-group">
                                    <label for="exampleInputFile">商家详情</label>
                                    <!-- 加载编辑器的容器 -->
                                    <script id="container" name="des" type="text/plain" style="width:100%;height:200px">{!!$data -> des!!}
                                    </script>
                                    <!-- 配置文件 -->
                                    <script type="text/javascript" src="{{url('/UEdit/ueditor.config.js')}}"></script>
                                    <!-- 编辑器源码文件 -->
                                    <script type="text/javascript" src="{{url('/UEdit/ueditor.all.js')}}"></script>
                                    <!-- 实例化编辑器 -->
                                    <script type="text/javascript">
                                        var ue = UE.getEditor('container');
                                    </script>
                            </div>
                          
                            </div><!-- /.box-body -->

                            <div class="box-footer">
                                <button type="submit" class="btn btn-primary">更新</button>
                                 <button type="reset" class="btn btn-default">重置</button>
                            </div>
                        </form>
                    </div><!-- /.box -->
		 	</div><!--/.col (left) -->
                
               
            </div>   <!-- /.row -->
        </section><!-- /.content -->
    </div><!-- /.content-wrapper -->

@endsection